package com.mitaotao._1_语法._3_分支._3_if判断;

import java.util.Scanner;

public class _02_根据输入的X的值输出Y_3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入数字：");
        int x = scanner.nextInt();
        int y =0;

        if (x>0){
            y=1;
        }
        else {
            if (x==0){
                y=0;
            }
            else {
                y=-1;
            }
        }
        System.out.println("y="+y);
        scanner.close();
    }
}
